package com.fjec.devops.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjec.common.annotation.OpeLog;
import com.fjec.common.protocol.JsonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fjec.devops.service.IBizYsOfflineRegService;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 * 023.银盛线下进件表 前端控制器
 * </p>
 *
 * @author admin
 * @since 2020-11-23
 */
@RestController
@RequestMapping("/")
public class BizYsOfflineRegController {

    @Resource
    private IBizYsOfflineRegService service;

    /**
     * 分页获取线下进件列表
     *
     * @param page
     * @return
     * @throws Exception
     */
    @GetMapping("/y/ys/get/offline/reg/list")
    public JsonResult getEntityListPage(Page page) throws Exception {
        return service.getEntityListPage(page);
    }

    /**
     * 下载线下进件excel
     *
     * @param id         进件数据id
     * @param downloadId 下载文件Id
     * @param type       下载类型 1=file1  2=file2
     * @param res
     * @throws Exception
     */
    @OpeLog(desc = "下载线下进件excel")
    @GetMapping("/y/ys/download/offline/excel")
    public void downloadYsOfflineExcel(Long id, Long downloadId, Integer type, HttpServletResponse res) throws Exception {
        service.downloadYsOfflineExcel(id, downloadId, type, res);
    }
}
